package cn.wolfcode.rbac.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.HashMap;
@Getter@Setter
public class Customertransfer extends BaseDomain{
    //客户姓名
    private Customer customer;
    //操作人
    //private Long operator_id;
    private Employee operator;
    //操作日期
    private String operate_time;
    //移交前的销售员
    private Employee oldSeller;
    //移交后的销售员
    private Employee newSeller;
    //移交原因
    private String reason;
    public String getOperate_time(){
        return this.operate_time.substring(0,this.operate_time.length()-2);
    }
    //获取页面中的data-json属性
    public String getJson(){
        HashMap<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("customer",customer);
        map.put("operator",operator);
        map.put("operate_time",operate_time);
        map.put("oldSeller",oldSeller);
        map.put("newSeller",newSeller);
        map.put("reason",reason);
        return JSON.toJSONString(map);
    }

}
